# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MigratableResource do
  @moduledoc """
  Represents one resource that exists in automl.googleapis.com, datalabeling.googleapis.com or ml.googleapis.com.

  ## Attributes

  *   `automlDataset` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MigratableResourceAutomlDataset.t`, *default:* `nil`) - Output only. Represents one Dataset in automl.googleapis.com.
  *   `automlModel` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MigratableResourceAutomlModel.t`, *default:* `nil`) - Output only. Represents one Model in automl.googleapis.com.
  *   `dataLabelingDataset` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MigratableResourceDataLabelingDataset.t`, *default:* `nil`) - Output only. Represents one Dataset in datalabeling.googleapis.com.
  *   `lastMigrateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when the last migration attempt on this MigratableResource started. Will not be set if there's no migration attempt on this MigratableResource.
  *   `lastUpdateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when this MigratableResource was last updated.
  *   `mlEngineModelVersion` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MigratableResourceMlEngineModelVersion.t`, *default:* `nil`) - Output only. Represents one Version in ml.googleapis.com.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :automlDataset =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MigratableResourceAutomlDataset.t()
            | nil,
          :automlModel =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MigratableResourceAutomlModel.t()
            | nil,
          :dataLabelingDataset =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MigratableResourceDataLabelingDataset.t()
            | nil,
          :lastMigrateTime => DateTime.t() | nil,
          :lastUpdateTime => DateTime.t() | nil,
          :mlEngineModelVersion =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MigratableResourceMlEngineModelVersion.t()
            | nil
        }

  field(:automlDataset,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MigratableResourceAutomlDataset
  )

  field(:automlModel,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MigratableResourceAutomlModel
  )

  field(:dataLabelingDataset,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MigratableResourceDataLabelingDataset
  )

  field(:lastMigrateTime, as: DateTime)
  field(:lastUpdateTime, as: DateTime)

  field(:mlEngineModelVersion,
    as:
      GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MigratableResourceMlEngineModelVersion
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MigratableResource do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MigratableResource.decode(value, options)
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1MigratableResource do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
